<div class="section">
     <?if(Yii::app()->user->hasFlash('opersuc')):?>
    <div class="messages green" onclick="$(this).fadeOut();" style="cursor:pointer;float:left;clear: both;padding-right: 10px;"><span></span><?=Yii::app()->user->getFlash('opersuc');?> </div>
    <?endif?>
		<div class="box">
			<div class="title">
				<h2><?=Yii::t('app','Редактирование новости')?></h2>
				<span class="hide"></span>
			</div>
<div class="content forms">

    <?$form=$this->beginWidget('CActiveForm', array(
        'id'=>'addnews-form',
        'enableAjaxValidation'=>true,
    )); ?>

    <?=$form->errorSummary($model); ?>


					<div class="line" style="border-top-width: 2px; border-top-style: solid; border-top-color: rgb(242, 244, 247); border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: rgb(242, 244, 247); ">
						<?=$form->label($model,'title'); ?>
                        <?=CHtml::activeTextField($model,'title',array('class'=>'xl')); ?>
					</div>


    <div class="line">
        		<?
        			$this->widget('pictures.components.PicturesEditor',
        				      array('mode' =>'AddAjax',
        				          'files' => $model->isNewRecord ? false : $model->getFiles(),
        				          'oneImage'=>true
        			));
        		?>
        	</div>

                      <div class="line">
                      <?=$form->label($model,'date_created'); ?>
                      <?if(strtotime($model->date_created)!=null){?>
                           <?=CHtml::activeTextField($model,'date_created',array('class'=>'datepicker','value'=>date('d.m.Y',strtotime($model->date_created)))); ?>
                      <?} else {?>
                           <?=CHtml::activeTextField($model,'date_created',array('class'=>'datepicker','value'=>date('d.m.Y'))); ?>
                      <?}?>
                                        </div>
                    <div class="line">
                       <?=$form->label($model,'is_active'); ?>
                       <!--<input type="checkbox" name="is_active" id="check-1" <?if($model->is_active == 1) echo 'checked';?> />-->
                        <?=$form->checkBox($model,'is_active')?>


                                        </div>

					
					<div class="line" style="border-top-width: 2px; border-top-style: solid; border-top-color: rgb(242, 244, 247); border-bottom-style: none; border-bottom-width: initial; border-bottom-color: initial; ">
				        <?=$form->label($model,'desc'); ?>
                        <?=CHtml::activeTextArea($model,'desc',array('class'=>'xl')); ?>
					</div>

                    <div class="line">
                        <?=$form->label($model,'content'); ?>
                        <? /*$this->widget('application.extensions.elrtef.elRTE', array(
                                                               'model' => $model,
                                                               'attribute' => 'content',
                                                               //'name' => 'text',
                                                               //'htmlOptions' => array('height' => '600'),
                                                               'options' => array(
                                                                       'doctype'=>'js:\'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\'',
                                                                       'cssClass' => 'el-rte',
                                                                       'cssfiles' => array('css/elrte-inner.css'),
                                                                       'absoluteURLs'=>true,
                                                                       'allowSource' => true,
                                                                       'lang' => 'ru',
                                                                       'styleWithCss'=>'',
                                                                       'height' => 400,
                                                                       'fmAllow'=>true, //if you want to use Media-manager
                                                                       'fmOpen'=>'js:function(callback) {$("<div id=\"elfinder\" />").elfinder(%elfopts%);}',//here used placeholder for settings
                                                                       'toolbar' => 'maxi',
                                                               ),
                                                               'elfoptions' => array( //elfinder options
                                                                   'url'=>'auto',  //if set auto - script tries to connect with native connector
                                                                   'passkey'=>'mypass', //here passkey from first connector`s line
                                                                   'lang'=>'ru',
                                                                   'dialog'=>array('width'=>'900','modal'=>true,'title'=>'Media Manager'),
                                                                   'closeOnEditorCallback'=>true,
                                                                   'editorCallback'=>'js:callback'
                                                               ),
                                                               )
                                                       );
                                                      */ ?>
                        <?php $this->widget('application.extensions.ckeditor.ECKEditor', array(
                        'model'=>$model,
                        'attribute'=>'content',
                        'language'=>'ru',
                        'editorTemplate'=>'full',
                        'options'=>array(
                            'filebrowserBrowseUrl'=>CHtml::normalizeUrl(array('/site/browse')),
                            'height'=>'400px;'
                        ),
                    )); ?>
                    </div>


                    <div class="line button">
                                            <? //save this news ?>
                                            <button type="submit" class="green medium"><span><?=Yii::t('app','Сохранить');?></span></button>
                                            <button type="submit" onclick="window.location.replace('<?=$this->createUrl("news/")?>');return false; " class="blue medium"><span>Отмена</span></button>
                                            
                                        </div>
<?$this->endWidget(); ?>

       </div>
                       

			</div>

	